package com.siwei.mes.entity.erp;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.siwei.mes.common.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * ERP任务单扩展信息 （品控）(RwdextraExtend)实体类
 *
 * @author linzi
 * @since 2024-08-02 16:22:23
 */
@Data
@Accessors(chain = true)
@Table(name = "pk_rwdextra_extend")
@ApiModel(value = "RwdextraExtend", description = "ERP任务单扩展信息 （品控）")
public class RwdextraExtend implements Serializable {
    private static final long serialVersionUID = 866340753854087186L;
    /**
     * 主键id
     */
    @Id
    @ApiModelProperty(value = "ERP任务单扩展信息 （品控）主键ID", name = "id")
    private Long id;
    /**
     * 任务单id
     */
    @Column(name = "frwdh")
    @ApiModelProperty(value = "任务单id", name = "frwdh")
    private Integer frwdh;

    @Column(name = "erp_customer_id")
    @ApiModelProperty(value = "erpCustomer表的id")
    @NotNull(groups = {UpdateGroup.class}, message = "客户id为空")
    private Long erpCustomerId;

    @Column(name = "erp_project_id")
    @ApiModelProperty(value = "erpProject表的id")
    @NotNull(groups = {UpdateGroup.class}, message = "工程id为空")
    private Long erpProjectId;
    /**
     * 任务单第一盘开始生产  0-未开始 1-一开始
     */
    @Column(name = "is_has_Itemorder")
    @ApiModelProperty(value = "任务单第一盘开始生产  0-未开始 1-已开始", name = "isHasItemorder")
    private Integer isHasItemorder = 0;

    @Column(name = "project_name")
    @ApiModelProperty(value = "修改后的工程名称")
    @NotBlank(groups = {UpdateGroup.class}, message = "工程名称为空")
    private String projectName = "";

    //这个字段弃用了  协会那边没有合同名称
    @Column(name = "contract_name")
    @ApiModelProperty(value = "修改后的合同名称")
    private String contractName = "";

    @Column(name = "build_name")
    @ApiModelProperty(value = "修改后的施工单位")
    private String buildName = "";

    /**
     * 细骨料含水率
     */
    @Column(name = "xgl_hsl")
    @ApiModelProperty(value = "细骨料含水率", name = "shalv")
    private String xglHsl = "";
    /**
     * 粗骨料含水率
     */
    @Column(name = "cgl_hsl")
    @ApiModelProperty(value = "粗骨料含水率", name = "hanshuilv")
    private String cglHsl = "";

    @Column(name = "llz_hl")
    @ApiModelProperty(value = "氯离子含量")
    private String llzHl;

    @Column(name = "is_gen_xnbg")
    @ApiModelProperty(value = "是否生成综合性能报告 1-生成 0-未生成")
    private Integer isGenXnbg = 0;

    @Column(name = "experiment_id")
    @ApiModelProperty(value = "性能报告的试验委托")
    private Long experimentId = null;

    @Column(name = "produce_Id")
    @ApiModelProperty(value = "协会任务单id")
    private String produceId = "";

    @Column(name = "consign_id")
    @ApiModelProperty(value = "协会委托id")
    private String consignId = "";

    @Column(name = "produce_index_id")
    @ApiModelProperty(value = "协会任务单indexId")
    private String produceIndexId = "";

    @Column(name = "reason")
    @ApiModelProperty(value = "协会任务单上传失败原因", name = "reason")
    private String reason;

    @Column(name = "status")
    @ApiModelProperty(value = "协会任务单上传状态")
    private String status = "";

    @Column(name = "print_status")
    @ApiModelProperty(value = "打印状态  1-已打印  0-未打印")
    private Integer printStatus;

    @Column(name = "print_json")
    @ApiModelProperty(value = "任务单打印的json")
    private JSONObject printJson;

    @Column(name = "open_appraisal_id")
    @ApiModelProperty(value = "开盘鉴定表主键ID")
    private Long openAppraisalId;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;
    /**
     * 质量证明书编号
     */
    @Column(name = "quality_certificate_no")
    @ApiModelProperty(value = "质量证明书编号", name = "qualityCertificateNo")
    private String qualityCertificateNo;
    /**
     * 配合比通知单编号
     */
    @Column(name = "mix_proportion_no")
    @ApiModelProperty(value = "配合比通知单编号", name = "mix_proportion_no")
    private String mixProportionNo;
    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    /**
     * 供应开始时间
     */
    @Column(name = "supply_start_time")
    @ApiModelProperty(value = "供应开始时间", name = "supplyStartTime")
    private Date supplyStartTime;

    /**
     * 供应结束时间
     */
    @Column(name = "supply_end_time")
    @ApiModelProperty(value = "供应结束时间", name = "supplyEndTime")
    private Date supplyEndTime;

    @Column(name = "plan_quantity")
    @ApiModelProperty(value = "计划方量")
    private String planQuantity;

    @Column(name = "FWcsl")
    @JSONField(name = "FWcsl")
    @JsonProperty(value = "FWcsl")
    @ApiModelProperty(value = "完成方量")
    private String FWcsl;

    @Column(name = "pouring_position")
    @ApiModelProperty(value = "浇筑部位")
    private String pouringPosition;

    @Column(name = "is_add_information")
    @ApiModelProperty(value = "是否增补资料  0-否 1-是")
    private Integer isAddInformation;

    @Column(name = "cgl_spec")
    @ApiModelProperty(value = "粗骨料规格")
    private String cglSpec;

    @Column(name = "materials_info_json")
    @ApiModelProperty(value = "任务单原材料json")
    private JSONObject materialsInfoJson;

    @Column(name = "bind_materials_time")
    @ApiModelProperty(value = "绑定原材料时间")
    private Date bindMaterialsTime;

    @Transient
    @ApiModelProperty(value = "多个任务单")
    private List<Integer> frwdhList;

    @Transient
    @ApiModelProperty(value = "任务单打印的对象")
    private RwdextraPrintInfo rwdextraPrintInfo;

    @Transient
    @ApiModelProperty(value = "计划开始时间")
    private String plantimeStart;

    @Transient
    @ApiModelProperty(value = "任务单对象")
    private Rwdextra rwdextra;

    @Transient
    @ApiModelProperty(value = "开盘鉴定编号")
    private String openAppraisalNo;

    @Transient
    @ApiModelProperty(value = "完成方量", name = "fhquantity")
    private String fhquantity;
}
